Skip to content

Fix flat-brace flipped content anchor#688

Merged
johannes-wolf merged 3 commits intomasterfrom
cetz-687-flat-brace-content-anchor
Aug 28, 2024
Merged

Fix flat-brace flipped content anchor#688
johannes-wolf merged 3 commits intomasterfrom
cetz-687-flat-brace-content-anchor

Conversation

@johannes-wolf
Copy link
Member

The whole function needs a rewrite (not for 0.3, though)!

Fixes #687

@johannes-wolf johannes-wolf added this to the 0.3.0 milestone Aug 19, 2024
Copy link
Member

@fenjalien fenjalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can some tests be added so this doesn't happen again?

@johannes-wolf johannes-wolf merged commit 8f92067 into master Aug 28, 2024
@johannes-wolf johannes-wolf deleted the cetz-687-flat-brace-content-anchor branch August 28, 2024 18:33
johannes-wolf added a commit that referenced this pull request Jan 21, 2026
)

## Problem

When `flip: true` is set on a brace, the brace is drawn pointing in the
opposite direction, but the `spike` and `content` anchors were always
positioned using positive amplitude values. This caused labels to appear
on the wrong side of flipped braces.

## Solution

This fix multiplies both `amplitude` and `content-offset` by -1 when
`flip` is true, ensuring anchors are positioned correctly on both normal
and flipped braces.

## Related Issues

This is similar to the fix for `flat-brace` in PR #688, but applies to
the regular `brace` function which was not included in that fix.

## Testing

Tested with both horizontal and diagonal braces, with and without flip.
Labels now correctly position on the appropriate side of the brace in
all cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible bug: flat-brace content anchor is misplaced if flip is set to true

2 participants